package com.exam.alibaba;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Scanner;

/**
 * date:
 * description:
 */
public class Solution003 {
    public static void main(String[] args) throws IOException {
        BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in));
        char[][] matrix = new char[4][4];
        for (int i = 0; i < matrix.length; i++) {
            for (int j = 0; j < matrix[0].length; j++) {
                matrix[i][j] = bufferedReader.readLine().charAt(0);
            }
        }
        for (int i = 0; i < matrix.length; i++) {
            for (int j = 0; j < matrix[0].length; j++) {
                if(Character.isDigit(matrix[i][j])){
                    dfs(matrix, i, j);
                }
            }
        }
        for (int i = 0; i < matrix.length; i++) {
            for (int j = 0; j < matrix[0].length; j++) {
                System.out.print(matrix[i][j] + " ");
            }
            System.out.println();
        }
    }

    public static void dfs(char[][] matrix, int i, int j){
        if(i < 0 || i >= matrix.length || j <= 0 || j >= matrix[0].length){
            return;
        }
        int count = matrix[i][j];
        for (int k = 0; k < count; k++) {

        }
    }
}
